import nock from "nock";

nock("https://matej10qa.appwrite.org:443", { encodedQueryParams: true })
    .post("/v1/account/sessions/anonymous", {})
    .reply(
        201,
        [
            "1f8b0800000000000003758f4b4fc3301084ff0a8a7a8346b6f392732ba8481ce80105ee49bca156533b5a3b1511e2bfe334210f559c6ccfcc7e3bfef6365278a917072c4c0acaa2a8e25c84050fa2c47bf03625426e41ecaccb30c2d896f02d8d331aa4419092d877b17b4252425cb835802f2b5858888a72522531753e7c3512610005b72036811ad41729005d34575a7567dd9a85fc7e6dbc10766509c664fa04ea5f63df2fefd6f61b5408e6b818948d3b69c47d1ac67e487dd6d7d1e6490b1802da1cf2f374ff0034528fb3652d41d9ac6b7abb9605e66edf9f3c1386f7483938f9ee196c799c9c99497d32a97bf529d58a3028ab06022eb284b9e0f07ec45c89a5f0ea96d6234ab7ca6237b6b3384b23256bf104d76fb4886eab975a6ce1e717a6aaa11137020000",
        ],
        [
            "Access-Control-Allow-Credentials",
            "true",
            "Access-Control-Allow-Headers",
            "Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-Appwrite-ID, Content-Range, Range, Cache-Control, Expires, Pragma",
            "Access-Control-Allow-Methods",
            "GET, POST, PUT, PATCH, DELETE",
            "Access-Control-Allow-Origin",
            "https://localhost",
            "Access-Control-Expose-Headers",
            "X-Fallback-Cookies",
            "Content-Encoding",
            "gzip",
            "Content-Length",
            "299",
            "Content-Type",
            "application/json; charset=UTF-8",
            "Date",
            "Fri, 16 Sep 2022 13:33:06 GMT",
            "Server",
            "Appwrite",
            "Set-Cookie",
            "a_session_6324555073b9706cb1f5_legacy=eyJpZCI6IjYzMjQ3YjEyNTRiZGYxOTBmNzYxIiwic2VjcmV0IjoiMGQ1NTZlYzIzMGE1OTdmNWY4NjNmM2ZlY2Q5NWMzYjQwOTRiYzk1YzAyMjA2OTY5YTJlNDk3NTNlMjBhYTU5YjNjYzY4MTNlMTUxMGNlNzg5OWM2MGY2Y2I1MThhYWVhNDQ4ZDcwZDhhMzllYzMzNjA2MjZiMTc5NjZkMmRjZWI0M2Q2MGJmNWRjNWNmMTBkZTk0ZDgwNDFjMzk4NGRhMTNiZjk5M2JlYmM4MTkzOWY3NDE4MmQzMzUyYzhmYjhhNDNjNDUxYzc0ZjViZGRhNjA2NDljZmYwZGQ2ODQ1NTkzMTRjZjI5Nzk4MDkxMTNiMGZhNzY0MzUwMzM4ZmI1NiJ9; expires=Sat, 16-Sep-2023 13:33:06 GMT; path=/; domain=.matej10qa.appwrite.org; secure; httponly",
            "Set-Cookie",
            "a_session_6324555073b9706cb1f5=eyJpZCI6IjYzMjQ3YjEyNTRiZGYxOTBmNzYxIiwic2VjcmV0IjoiMGQ1NTZlYzIzMGE1OTdmNWY4NjNmM2ZlY2Q5NWMzYjQwOTRiYzk1YzAyMjA2OTY5YTJlNDk3NTNlMjBhYTU5YjNjYzY4MTNlMTUxMGNlNzg5OWM2MGY2Y2I1MThhYWVhNDQ4ZDcwZDhhMzllYzMzNjA2MjZiMTc5NjZkMmRjZWI0M2Q2MGJmNWRjNWNmMTBkZTk0ZDgwNDFjMzk4NGRhMTNiZjk5M2JlYmM4MTkzOWY3NDE4MmQzMzUyYzhmYjhhNDNjNDUxYzc0ZjViZGRhNjA2NDljZmYwZGQ2ODQ1NTkzMTRjZjI5Nzk4MDkxMTNiMGZhNzY0MzUwMzM4ZmI1NiJ9; expires=Sat, 16-Sep-2023 13:33:06 GMT; path=/; domain=.matej10qa.appwrite.org; secure; httponly; samesite=None",
            "X-Content-Type-Options",
            "nosniff",
            "X-Debug-Fallback",
            "true",
            "X-Debug-Speed",
            "0.021300077438354",
            "X-Fallback-Cookies",
            '{"a_session_6324555073b9706cb1f5":"eyJpZCI6IjYzMjQ3YjEyNTRiZGYxOTBmNzYxIiwic2VjcmV0IjoiMGQ1NTZlYzIzMGE1OTdmNWY4NjNmM2ZlY2Q5NWMzYjQwOTRiYzk1YzAyMjA2OTY5YTJlNDk3NTNlMjBhYTU5YjNjYzY4MTNlMTUxMGNlNzg5OWM2MGY2Y2I1MThhYWVhNDQ4ZDcwZDhhMzllYzMzNjA2MjZiMTc5NjZkMmRjZWI0M2Q2MGJmNWRjNWNmMTBkZTk0ZDgwNDFjMzk4NGRhMTNiZjk5M2JlYmM4MTkzOWY3NDE4MmQzMzUyYzhmYjhhNDNjNDUxYzc0ZjViZGRhNjA2NDljZmYwZGQ2ODQ1NTkzMTRjZjI5Nzk4MDkxMTNiMGZhNzY0MzUwMzM4ZmI1NiJ9"}',
            "X-Ratelimit-Limit",
            "50",
            "X-Ratelimit-Remaining",
            "25",
            "X-Ratelimit-Reset",
            "1663336800",
            "Connection",
            "close",
        ],
    );

nock("https://matej10qa.appwrite.org:443", { encodedQueryParams: true })
    .patch(
        "/v1/databases/632455a0b8d017403ce9/collections/632455a55dc72e1aa016/documents/63245b02205ba8cec507",
        {
            data: { title: "Updated" },
            permissions: ['read("any")', 'write("any")'],
        },
    )
    .reply(
        200,
        [
            "1f8b0800000000000003658f3dcf02211084ffcbc6e2357e6417843be92cedb5d2b7e0600b123c2f0716c6f8df8598e825b633cfcecc3e20871c190c1c076f337b5882e7e4c630e470edc1f4b71897300bbe205a8a8dea5008549d6d1d3b854de1676ee47abacb8511c55ee17645fa4064481b6ad724c502d12056f8f6eef981a591d2a05e2b855f78e0f112522a4b129813941eff7706dbdfcf302ffe3b6baa788e3c55feebbc6b8cecea3bfbcf17ca2ae55d2398ac45d2b5ab44d9ce269e42d8b51ea9d9a074bc85e70b84a7bf172e010000",
        ],
        [
            "Access-Control-Allow-Credentials",
            "true",
            "Access-Control-Allow-Headers",
            "Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-Appwrite-ID, Content-Range, Range, Cache-Control, Expires, Pragma",
            "Access-Control-Allow-Methods",
            "GET, POST, PUT, PATCH, DELETE",
            "Access-Control-Allow-Origin",
            "https://localhost",
            "Access-Control-Expose-Headers",
            "X-Fallback-Cookies",
            "Content-Encoding",
            "gzip",
            "Content-Length",
            "211",
            "Content-Type",
            "application/json; charset=UTF-8",
            "Date",
            "Fri, 16 Sep 2022 13:33:06 GMT",
            "Server",
            "Appwrite",
            "X-Content-Type-Options",
            "nosniff",
            "X-Debug-Fallback",
            "true",
            "X-Debug-Speed",
            "0.010154008865356",
            "X-Ratelimit-Limit",
            "120",
            "X-Ratelimit-Remaining",
            "119",
            "X-Ratelimit-Reset",
            "1663335240",
            "Connection",
            "close",
        ],
    );
